define(['jsMvc','zepto'],function(jsMvc,$){
	/*初始化iscroll 加入上拉下拉事件*/
	// function loaded() {
	function indexStart(){
		var model = {};

		jsMvc.AddRoute(HomeController, 'home', 'Views/home.html');
	    jsMvc.AddRoute(ContactController, 'contact', 'Views/contact.html');
	    jsMvc.AddRoute(AdminController, 'admin', 'Views/admin.html');
	    jsMvc.AddRoute(WeatherController, 'weather', 'Views/weather.html');
	    jsMvc.Initialize();
	    
	    document.addEventListener('DOMContentLoaded', onLoad());

	    var lnkGetWeather = null;

		function onLoad() {
	        cboStates = document.getElementById('cboStates');
	        lnkGetWeather = document.getElementById('lnkGetWeather');
	        lnkGetWeather.addEventListener('click', function (e)
	        {
	            window.open("index.html#/weather", '_parent');
	            e.preventDefault();
	        });
	    }
	    function HomeController(view, model) {
	        model.Message = 'Hello World';
	    }
	    function ContactController(view, model) {
	        model.FirstName = "John";
	        model.LastName = "Doe";
	        model.Phone = '555-123456';
	    }
	    function AdminController(view, model) {
	        model.UserName = "John";
	        model.Password = "MyPassword";
	    }
	    function WeatherController(view, model) {
	        view.isAsync = true;
	        var query = escape('select item from weather.forecast where location="INXX0096"'),
	        url = "http://query.yahooapis.com/v1/public/yql?q=" + query + "&format=json&callback=?";
	        $.getJSON(url, function (data)
	        {
	            if (data)
	            {
	                model.Title = data.query.results.channel.item.title;
	                model.Date = data.query.results.channel.item.pubDate;
	                model.Longitude = data.query.results.channel.item.lat;
	                model.Latitude = data.query.results.channel.item.long;
	                model.Description = data.query.results.channel.item.description;
	                view.render();
	            }
	        });
	    }
	}

	return {
		indexStart: indexStart,
	}
})